package com.parkinglot.controller;

import com.parkinglot.core.Result;
import com.parkinglot.pojo.Wechatconfig;
import com.parkinglot.service.WechatconfigService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Slf4j
@RestController
@RequestMapping("wechatconfig")
@ApiOperation("小程序配置管理")
public class WechatconfigController {
    @Resource
    private WechatconfigService wechatconfigService;

    @ApiOperation(value = "新增广告")
    @PostMapping("/addadvert")
    public Result addadvert(Wechatconfig wechatconfig, @RequestParam(value = "file") MultipartFile[] files, HttpServletRequest request){
        return Result.success(wechatconfigService.addimg(wechatconfig,files,request));
    }

}
